package tp5;

import java.rmi.Naming;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

class Guichet {
	
	
	public void ouverture(Client c) {
		 try {
			 ICB stub = (ICB)
			 Naming.lookup("rmi://localhost:"+ICB.PORT+"/"+ICB.CB);
	            stub.setCodeClient(c.codeClient);
	            System.out.println("le code client de CB distant : "+
	            		stub.getCodeClient()
	            		);
	            
	        } catch (Exception e) {
	            e.printStackTrace();
	        }
	}

public static void main(String[] args) {
	Guichet guichet = new Guichet();
	Client client = new Client();
	client.codeClient = 321321321;
	guichet.ouverture(client);
}

}